<template>
	<view class="">
		
	</view>
</template>

<script>
	import { payOrder } from "@/api/public.js"
	export default {
		data(){
			return {
				
			}
		},
		mounted(){
			payOrder().then(res=>{
				console.log((String(Date.now())/1000).toFixed(0))
				uni.requestPayment({
					provider: 'wxpay',
					appid: res.reData.data.appId,
					timeStamp: ""+res.reData.data.timeStamp,
					nonceStr: res.reData.data.nonceStr,
					package: res.reData.data.package,
					signType: res.reData.data.signType,
					paySign: res.reData.data.paySign,
					success: function (res) {
						console.log('success:' + JSON.stringify(res));
						uni.switchTab({
							url: "../mine/mine"
						})
					},
					fail: function (err) {
						console.log('fail:' + JSON.stringify(err));
					}
				});
			})
		}
	}
</script>

<style lang="scss" scoped>

</style>
